﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebChatApi.Common.Interface;

namespace WebChatApi.Common.Interface
{
    /// <summary>
    /// Interface for base messaging util
    /// </summary>
    /// <typeparam name="TService">The type of the service.</typeparam>
    /// <typeparam name="TMessage">The type of the message.</typeparam>
    public interface IBaseMessagingUtil<TService, TMessage> where TService : IBaseMessagingService<TMessage>
    {
        /// <summary>
        /// Gets the message template by key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="cultureInfo">The culture info.</param>
        /// <returns></returns>
        MessageTemplate GetMessageTemplateByKey(string key, string cultureInfo);

        /// <summary>
        /// Updates the message template by key.
        /// </summary>
        /// <param name="messageTemplate">The message template.</param>
        void UpdateMessageTemplateByKey(MessageTemplate messageTemplate);

        /// <summary>
        /// Creates the service proxy.
        /// </summary>
        /// <param name="serviceUrl">The service URL.</param>
        /// <returns></returns>
        TService CreateServiceProxy(string serviceUrl = null);

        /// <summary>
        /// Sends the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        MessagingResponse Send(TMessage message);
    }
}
